package com.ktwlsoft.archivemanage.domain.business.repositoryService;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ktwlsoft.archivemanage.domain.dao.repository.ICopyToMapper;
import com.ktwlsoft.archivemanage.domain.dao.entity.CopyTo;

/**
 * copy_to--抄送业务层接口实现类
 *
 * @author zhuhe on 2020-04-29 14:56:33
 * @version 1.0
 */
@Service
public class CopyToRepositoryService {
	
	@Autowired
	private ICopyToMapper copyToMapper;

    /**
 	 * 查询分页 on 2020-04-29 14:56:33
 	 * @param pn 第几页
     * @param pageSize 每页多少条
 	 * @param copyTo copyTo
 	 * @return PageInfo<CopyTo>
 	 */
	public PageInfo<CopyTo> findPage(int pn,int pageSize,CopyTo copyTo) {
		PageHelper.startPage(pn,pageSize);
		PageInfo<CopyTo> pageInfo = new PageInfo<CopyTo>(copyToMapper.findList(copyTo));
		return pageInfo;
	}

    /**
	 * 查询集合 on 2020-04-29 14:56:33
	 * @param copyTo copyTo
	 * @return List<CopyTo>
	 */
	public List<CopyTo> findList(CopyTo copyTo) {
		return copyToMapper.findList(copyTo);
	}

    /**
	 * 根据ID查询信息 on 2020-04-29 14:56:33
	 * @param id	主键
	 * @return CopyTo
	 */
	public CopyTo getById(Long id){
		return copyToMapper.getById(id);
	}

   /**
	 * 新增 on 2020-04-29 14:56:33
	 * @param copyTo copyTo
	 * @return int
	 */
	public int insert(CopyTo copyTo){
		return copyToMapper.insert(copyTo);
	}

	/**
	 * 批量插入 2020-04-29 14:56:33
	 *
	 * @param list list
	 * @return int
	 */
	public int manyInsert(List<CopyTo> list){
	    return copyToMapper.manyInsert(list);
	}

   /**
	 * 修改 on 2020-04-29 14:56:33
	 * @param copyTo copyTo
	 * @return int
	 */
	public int update(CopyTo copyTo){
		return copyToMapper.update(copyTo);
	}

   /**
	 * 根据id集合批量删除信息 on 2020-04-29 14:56:33
	 * @param copyToArr	主键编号集合
	 * @return int
	 */
	public int deleteByIds(List<Long> copyToArr){
		return copyToMapper.deleteByIds(copyToArr);
	}

   /**
	 * 根据id删除信息 on 2020-04-29 14:56:33
	 * @param id id
	 * @return int
	 */
	public int deleteById(Long id){
		return copyToMapper.deleteById(id);
	}
}
